import javax.naming.InitialContext;
import javax.naming.NamingException;

import controller.OpBeanRemote;


public class Main {
	public static void main(String[] args) {
		
		
		try {
			InitialContext ic = new InitialContext();
			//FirstBeanRemote fbr = (FirstBeanRemote) ic.lookup("java:global/First_EAR/First_EJB/FirstBean!controller.FirstBeanRemote");
			//AsynchronousSessionBeanRemote asb = (AsynchronousSessionBeanRemote) ic.lookup("java:global/First_EAR/First_EJB/AsynchronousSessionBean!controller.AsynchronousSessionBeanRemote");
			OpBeanRemote ops = (OpBeanRemote) ic.lookup("java:global/First_EAR/First_EJB/OpBean!controller.OpBeanRemote");
			
			//System.out.println(fbr.suma(3, 5));
			System.out.println("Alege operatia:\n1 Scadere:\n2 Adunare:");
			java.util.Scanner sc = new java.util.Scanner(System.in);
			
			int option = sc.nextInt();
			sc.close();
			System.out.println(ops.doOperation(option));
			
		} catch (NamingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	/* (non-Java-doc)
	 * @see java.lang.Object#Object()
	 */
	public Main() {
		super();
	}

}